<template>
  <div style="padding: 6px;">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px">
      <el-form-item label="姓名" prop="name">
        <el-input style="width: 200px" v-model="queryParams.name"></el-input>
      </el-form-item>
      <el-form-item label="身份证" prop="idCard">
        <el-input style="width: 200px" v-model="queryParams.idCard"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="loadDangAnRenYuan">查询</el-button>
      </el-form-item>
    </el-form>

    <el-table :data="dangAnRenYuanObj.list" border style="width: 100%">
      <el-table-column label="人员ID" prop="renyuanid"></el-table-column>
      <el-table-column label="姓名" prop="name"></el-table-column>
      <el-table-column label="身份证" prop="idcard"></el-table-column>
      <el-table-column label="手机号" prop="phone"></el-table-column>
      <el-table-column label="最后同步时间">
        <template v-slot="scope">
          <DateFormat :value="scope.row.lastupdatetime" :format="'YYYY-MM-DD HH:mm'"></DateFormat>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination class="center" background layout="total, prev, pager, next"
                   @current-change="loadDangAnRenYuan" :total="dangAnRenYuanObj.total"
                   :current-page.sync="queryParams.pageNum" :page-size="queryParams.pageSize">
    </el-pagination>
  </div>
</template>

<script>
import request from '@/utils/request'
export default {
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 15,
        idCard:'',
        name:'',
      },
      dangAnRenYuanObj:{},
    }
  },
  mounted() {
    this.loadDangAnRenYuan()
  },
  methods: {
    loadDangAnRenYuan() {
      request({
        url: '/basicdata/pageoarenyuandangan',
        data: this.queryParams
      }).then(res => {
        const { data } = res
        this.dangAnRenYuanObj = data
      })
    },
  }
}
</script>
